package com.ityu.blockapi.controller;


import com.ityu.common.utils.Utils;
import com.ityu.common.vo.front.Ret;
import com.ityu.common.vo.front.Rets;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/ethapi")
@Slf4j
public class EthController {

    @ApiOperation(value = "test")
    @ApiImplicitParams({ // 参数说明
            @ApiImplicitParam(name = "title", paramType = "query", value = "string", dataType = "string")
    })
    @GetMapping(value = "/test")
    public Ret<String> test(@RequestParam(value = "title") String title, HttpServletRequest request) {
        Utils.myLog(request.getServletContext().getRealPath("/upload"));
        return Rets.success(title);
    }

}
